//封装发送请求
function request(params){
    var basePath = "http://localhost:8080"
    return new Promise((resolve,reject)=>{
        //显示加载框
        wx.showLoading({
          title: '正在请求',
        })
        wx.request({
          ...params,
          url:basePath+params.url,
          success : (res)=>{resolve(res)},
          fail :(err)=>{reject(err)}
        })
        //最后关闭加载提示
        wx.hideLoading({
          success: (res) => {},
        })
    })
}


export default request